{php include wl_template('common/header');}
<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#">类型列表</a></li>
</ul>
<style type="text/css">
	.page-heading {
		padding: 5px 0;
		border-bottom: 1px solid #ccc;
		margin-bottom: 20px;
		position: relative;
		margin-left: 15px;
	}
	#material-Modal {
		z-index: 2051;
	}
</style>
<div class="app-content">
	<div class="app-filter">
		<div class="filter-action">
     	   <a class="btn btn-primary" href="{php echo web_url('halfcard/halftype/editlevel')}" data-toggle="ajaxModal">增加等级</a>
		</div>
	</div>	
	<div class="app-table-list">
		<div class="table-responsive">
			<table class="table table-hover table-bordered">
				<thead>
				<tr>
					<th class="text-center" style="width:30px;">ID</th>
					<th class="text-center" style="width:100px;">等级名称(点击修改)</th>
					<th class="text-center" style="width:100px;">状态(点击修改)</th>
					<th class="text-center" style="width:100px;">排序(点击修改)</th>
					<th class="text-center" style="width:100px;">操作</th>
				</tr>
				</thead>
				<tbody>
				<tr class="text-center" >
					<td>
						0
					</td>
					<td>
						<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => 'default','type'=>1))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" >
							{$base['name']}
						</a>
					</td>
					<td>
						<span class='label label-success'>总是显示</span>
					</td>
					<td>
						<span class='label label-success'>置顶</span>
					</td>
					<td style="position:relative;">
						<a href="{php echo web_url('halfcard/halftype/editlevel',array('id'=>'default'))}" data-toggle="ajaxModal">编辑  </a>
					</td>
				</tr>
				{loop $levels $item}
				<tr class="text-center" >
					<td>
						{$item['id']}
					</td>
					<td>
						<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => $item['id'],'type'=>1))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" >
							{$item['name']}
						</a>
					</td>
					<td>
						<span class="change">
						<span  class='label {if $item['status']==1}label label-primary {else}label-default{/if}'
							data-toggle='ajaxSwitch'
							data-switch-value='{$item['status']}'
							data-switch-value0='0|关闭|label label-default|{php echo web_url('halfcard/halftype/changelevel',array('type'=>3,'value'=>1,'id'=>$item['id']))}'
							data-switch-value1='1|开启|label label-primary|{php echo web_url('halfcard/halftype/changelevel',array('type'=>3,'value'=>0,'id'=>$item['id']))}'>
							{if $item['status']==1}开启{else}关闭{/if}
						</span>
						</span>
					</td>
					<td>
						<a data-href="{php echo web_url('halfcard/halftype/changelevel',array('id' => $item['id'],'type'=>2))}" href="javascript:;" title="修改名称" data-toggle="ajaxEdit" >
							{$item['sort']}
						</a>
					</td>
					<td style="position:relative;">
						<a href="{php echo web_url('halfcard/halftype/editlevel',array('id'=>$item['id']))}" data-toggle="ajaxModal">编辑  </a>
						<a data-toggle="ajaxRemove" href="{php echo web_url('halfcard/halftype/changelevel',array('type'=>4,'id'=>$item['id']));}" data-confirm='确认删除此等级？'> - 删除</a>
					</td>
				</tr>
				{/loop}
				</tbody>
			</table>
		</div>
		<div class="app-table-foot clearfix">
			<div class="pull-left">
				
			</div>
			<div class="pull-right">
				{$pager}
			</div>
		</div>
	</div>
	<style>
		.change:hover{
			cursor:pointer;
		}
	</style>
</div>


{php include wl_template('common/footer');}